<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr" lang="en-gb">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>账户管理</title>
<link type="text/css" rel="Stylesheet"
	href="/PCT/StyleAll/styleLogIn.css" />
<link type="text/css" rel="Stylesheet" href="/PCT/StyleAll/styleAll.css" />
<script type="text/javascript">
	function validate_height(field, alerttxt) {
		with (field) {
			var regx = /^\d{2,3}$/;
			if (value != null && value != "") {
				if (!regx.test(value)) {
					alert(alerttxt);
					return false
				} else {
					return true
				}
			}
		}
	}
	function validate_weight(field, alerttxt) {
		with (field) {
			var regx = /^\d{2,3}$/;
			if (value != null && value != "") {
				if (!regx.test(value)) {
					alert(alerttxt);
					return false
				} else {
					return true
				}
			}
		}
	}
	function validate_email(field, alerttxt) {
		with (field) {
			if (value != null && value != "") {
				apos = value.indexOf("@")
				dotpos = value.lastIndexOf(".")
				if (apos < 1 || dotpos - apos < 2) {
					alert(alerttxt);
					return false
				} else {
					return true
				}
			}
		}
	}
	function validate_passward(field, alerttxt) {
		with (field) {
			plength = value.length
			if (plength<8||plength>30) {
				alert(alerttxt);
				return false
			} else {
				return true
			}
		}
	}
	function validate_form(thisform) {
		with (thisform) {
			if (validate_height(height, "非法的身高!") == false) {
				height.focus();
				return false
			} else if (validate_weight(weight, "非法的体重!") == false) {
				weight.focus();
				return false
			} else if (validate_email(email, "非法的E-mail地址!") == false) {
				email.focus();
				return false
			}
		}
	}
</script>
<style type="text/css">
.STYLE1 {
	font-size: 36px
}
</style>
</head>

<body class="browser-webkit can-transform has-shadows transform">
	<div class="header">
		<a> <img src="/PCT/image/Logo Small.png" width=1000px height=50px
			alt="Logo Small">
		</a>
	</div>
	<p>&nbsp;</p>
	<div class="page">
		<div id="page-header">
			<div id="search-box">
				<s:if test="#session.status.currentUser.userType == 1">病友：</s:if>
				<s:elseif test="#session.status.currentUser.userType == 2">医生：</s:elseif>
				<s:elseif test="#session.status.currentUser.userType == 3">管理员：</s:elseif>
				<a><s:property value="#session.status.currentUser.username" /></a> 等级：
				<a><s:property value="#session.status.currentUser.rank" /></a>
					<img src="/PCT/image/2.png" width=15px height=15px>
					<a href=" <s:url action='logout' namespace='/secure'/>">退出</a>
				</div>
			<a href="<s:url action='redirectResult' namespace='/public'>
				<s:param name='redirectType' value='8' />
			</s:url>" class="button2">系统消息</a>
			<a href="<s:url action='redirectResult' namespace='/public'>
				<s:param name='redirectType' value='10' />
			</s:url>" class="button2">我的群</a>
		</div>
		<div id="page-body">
			<table width="100%" border="1">
				<tr>
					<td width="30%">
						<div id="page-body">
							<h2>个人资料</h2>
							<form method="post"
								action="http://demo.phpbb3styles.net/memberlist.php?style=704&mode=group"
								id="viewprofile">
								<div class="panel bg1">
									<div class="inner">
										<dl class="left-box details" style="width: 80%;">
											<dt>用户名：</dt>
											<dd>
												<span style="color: #AA0000; font-weight: bold;"><s:property
														value="#session.status.currentUser.username" /></span>
											</dd>
											<dt>性别：</dt>
											<dd>
												<s:if test="#session.status.currentUser.gender == false">男</s:if>
												<s:elseif test="#session.status.currentUser.gender == true">女</s:elseif>
											</dd>
											<dt>身高：</dt>
											<dd>
												<s:if test="#session.status.currentUser.height == 0">未填写</s:if>
												<s:elseif test="#session.status.currentUser.height != 0">
													<s:property value="#session.status.currentUser.height" />厘米
												</s:elseif>
											</dd>
											<dt>体重：</dt>
											<dd>
												<s:if test="#session.status.currentUser.weight == 0">未填写</s:if>
												<s:elseif test="#session.status.currentUser.weight != 0">
													<s:property value="#session.status.currentUser.weight" />千克
												</s:elseif>
											</dd>
											<dt>出生年月：</dt>
											<dd>
												<s:if test="#session.status.currentUser.birthday == null">未填写</s:if>
												<s:elseif
													test="#session.status.currentUser.birthday != null">
													<s:property value="#session.status.year" />年<s:property
														value="#session.status.month+1" />月</s:elseif>
											</dd>
											<dt>住址：</dt>
											<dd>
												<s:if test="#session.status.currentUser.location == null">未填写</s:if>
												<s:elseif
													test="#session.status.currentUser.location != null">
													<s:property value="#session.status.currentUser.location" />
												</s:elseif>
											</dd>
											<dt>e-mail：</dt>
											<dd>
												<s:if test="#session.status.currentUser.email == null">未填写</s:if>
												<s:elseif test="#session.status.currentUser.email != null">
													<s:property value="#session.status.currentUser.email" />
												</s:elseif>
											</dd>
											<dt>用户类型：</dt>
											<dd>
												<s:if test="#session.status.currentUser.userType == 1">病友</s:if>
												<s:elseif test="#session.status.currentUser.email == 2">医生</s:elseif>
												<s:elseif test="#session.status.currentUser.email == 3">管理员</s:elseif>
											</dd>
										</dl>
										<span class="corners-bottom"></span>
									</div>
								</div>
							</form>
						</div>
					</td>
					<td width="40%">
						<div id="page-body">
							<div class="panel">
								<div class="inner">
									<span class="corners-top"><span></span></span>
									<h2>基本信息修改</h2>
									<fieldset class="fields2">
										<s:form action="manageAccount" namespace="/public">
											<s:select label="性别" name="gender" list="#{'false':'男', 'true':'女'}" />
											<s:textfield name="height" label="身高（厘米）" size="25"
												cssClass="inputbox autowidth" />
											<s:textfield name="weight" label="体重（千克）" size="25"
												cssClass="inputbox autowidth" />
												<s:textfield name="location" label="住址" size="25"
												cssClass="inputbox autowidth" />
											<s:textfield name="email" label="邮箱" size="25"
												cssClass="inputbox autowidth" />
											<s:select label="出生年份" name="year"
												list="#{'2012':'2012', 
							  											'2011':'2011',
							  											'2010':'2010',
																		'2009':'2009',
																		'2008':'2008',
																		'2007':'2007',
																		'2006':'2006',
																		'2005':'2005',
																		'2004':'2004',
																		'2003':'2003',
																		'2002':'2002',
																		'2001':'2001',
																		'2000':'2000',
																		'1999':'1999',
																		'1998':'1998',
																		'1997':'1997',
																		'1996':'1996',
																		'1995':'1995',
																		'1994':'1994',
																		'1993':'1993',
																		'1992':'1992',
																		'1991':'1991',
																		'1990':'1990',
																		'1989':'1989',
																		'1988':'1988',
																		'1987':'1987',
																		'1986':'1986',
																		'1985':'1985',
																		'1984':'1984',
																		'1983':'1983',
																		'1982':'1982',
																		'1981':'1981',
																		'1980':'1980',
																		'1979':'1979',
																		'1978':'1978',
																		'1977':'1977',
																		'1976':'1976',
																		'1975':'1975',
																		'1974':'1974',
																		'1973':'1973',
																		'1972':'1972',
																		'1971':'1971',
																		'1970':'1970',
																		'1969':'1969',
																		'1968':'1968',
																		'1967':'1967',
																		'1966':'1966',
																		'1965':'1965',
																		'1964':'1964',
																		'1963':'1963',
																		'1962':'1962',
																		'1961':'1961',
																		'1960':'1960',
																		'1959':'1959',
																		'1958':'1958',
																		'1957':'1957',
																		'1956':'1956',
																		'1955':'1955',
																		'1954':'1954',
																		'1953':'1953',
																		'1952':'1952',
																		'1951':'1951',
																		'1950':'1950'}" />
											<s:select label="出生月份" name="month"
												list="#{'1':'1', 
							  											'2':'2',
							  											'3':'3',
																		'4':'4',
																		'5':'5',
																		'6':'6',
																		'7':'7',
																		'8':'8',
																		'9':'9',
																		'10':'10',
																		'11':'11',
																		'12':'12'}" />
											<s:submit value=" 确定 "
												cssClass="button1 default-submit-action" />
										</s:form>
									</fieldset>
									<span class="corners-bottom"><span></span></span>
								</div>
							</div>
						</div>
					</td>
					<td>
						<div id="page-body">
							<div class="panel">
								<div class="inner">
									<span class="corners-top"><span></span></span>
									<h2>安全信息修改</h2>
									<fieldset class="fields2">
										<s:form action="updatePassword" namespace="/public">
											<s:password name="password" label="请输入原密码" size="25"
												cssClass="inputbox autowidth" />
											<s:password name="passwordNew" label="请输入新密码" size="25"
												cssClass="inputbox autowidth" />
											<s:password name="passwordNewConfirm" label="请再输入一次"
												size="25" cssClass="inputbox autowidth" />
											<s:textfield name="question" label="密保问题" size="25"
												cssClass="inputbox autowidth" />
											<s:textfield name="answer" label="密保答案" size="25"
												cssClass="inputbox autowidth" />
											<s:submit value=" 确定 "
												cssClass="button1 default-submit-action" />
										</s:form>
									</fieldset>
									<span class="corners-bottom"><span></span></span>
								</div>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="footer">
		<div class="copyright">
			<p class="copy-left">上海交通大学 软件学院</p>
			<p class="copy-right">
				设计风格 <a href=" http://www.artodia.com/">Artodia</a> 。
			</p>
		</div>
	</div>
</body>
</html>
